package com.kun.hanlp;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.dictionary.DynamicCustomDictionary;
import com.hankcs.hanlp.seg.Segment;
import com.hankcs.hanlp.seg.common.Term;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kun.li
 */
public class SegmentTest2 {


    @Test
    public void testA() {
        String root="D:/ocean/";
        System.setProperty("HANLP_ROOT",root);
        //D:\ocean\data\dictionary\custom
        List<String> customDictionPathList =new ArrayList<>();
        customDictionPathList.add(root+"data/dictionary/custom/test.txt");
        customDictionPathList.add(root+"data/dictionary/custom/CustomDictionary.txt");
        HanLP.Config.CustomDictionaryPath=customDictionPathList.toArray(new String[]{});
        HanLP.Config.enableDebug();
        Segment segment = HanLP.newSegment();
        List<Term> termList = segment.seg("叶家桥东路");
        System.out.println(termList);
    }

}
